:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --heading-color: #262626;
    --text-color: #595959;
    --border-color: #e8e8e8;
    --bg-color: #f5f5f5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

h1 {
    color: var(--heading-color);
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 32px;
    text-align: center;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.input-section {
    margin-bottom: 24px;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.button-group {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

button {
    padding: 8px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background-color: #40a9ff;
}

button:active {
    background-color: #096dd9;
}

button:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

.result-section {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.result-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h2 {
    margin: 0;
    font-size: 16px;
    color: var(--heading-color);
    font-weight: 500;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-color);
    font-size: 14px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 12px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.json-viewer {
    padding: 24px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    background-color: #fafafa;
    border-radius: 0 0 8px 8px;
}

.json-key {
    color: #d63200;
    cursor: default;
}

.json-string {
    color: #0b7500;
}

.json-number {
    color: #1677ff;
}

.json-boolean {
    color: #bf2a1d;
}

.json-null {
    color: #808080;
}

.json-array, .json-object {
    margin-left: 24px;
    transition: all 0.3s ease;
}

.json-property {
    padding: 2px 0;
    transition: background-color 0.3s;
}

.json-property:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    color: var(--text-color);
    transition: transform 0.3s;
    font-size: 12px;
}

.toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.error {
    color: var(--error-color);
    padding: 16px 24px;
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
}

.collapsible {
    cursor: pointer;
    user-select: none;
}

.collapsible .toggle-btn {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.collapsible-content {
    margin-left: 20px;
    transition: all 0.3s ease;
}

.hidden {
    display: none;
}

.json-object-wrapper, .json-array-wrapper {
    margin: 2px 0;
}

.json-property {
    margin: 2px 0;
    padding: 2px 0;
}

.json-key {
    color: #d63200;
    cursor: pointer;
}

.json-string {
    color: #0b7500;
}

.json-number {
    color: #1677ff;
}

.json-boolean {
    color: #bf2a1d;
}

.json-null {
    color: #808080;
}